import qs from 'qs'
/**
 * 获取url上实际参数
 */
export const getUrlParams = () => {
  const str = window.location.search.replace('?', '')
  return qs.parse(str)
}

/**
 * 替换双斜线到单斜线
 * @param str
 */
export const replaceDbBiasToSingle = (str:string) => {
  return str.replace(/\/\//g, '/')
}

/**
 * 删除无值属性
 * @param obj
 */
export const delEmptyProp = (obj:Record<string, any>) => {
  const result = {...obj}
  for (let key in result) {
    if (result[key] === '') {
      delete result[key]
    }
  }
  return result
}